package data;

// Account.java
// Represents a bank account, and its content

public class Account {
	
	private String accountType;
	private int accountNumber; // account number
	private double availableBalance; // funds available for withdrawal
	private double totalBalance; // funds available + pending deposits

	// Account constructor initializes attributes
	public Account(String accountType, int accountNumber, 
			double availableBalance, double totalBalance) {
		this.accountType = accountType;
		this.accountNumber = accountNumber;
		this.availableBalance = availableBalance;
		this.totalBalance = totalBalance;
	} // end Account constructor

	public String getAccountType() {
		return accountType;
	}

	public int getAccountNumber() {
		return accountNumber;
	}

	public double getAvailableBalance() {
		return availableBalance;
	}

	public double getTotalBalance() {
		return totalBalance;
	}

	// credits an amount to the account
	public void credit(double amount) {
		totalBalance += amount; // add to total balance
		availableBalance += amount;
	} // end method credit

	// debits an amount from the account
	public void debit(double amount) {
		availableBalance -= amount; // subtract from available balance
		totalBalance -= amount; // subtract from total balance
	} // end method debit

	// returns account number

} // end class Account
